Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 3 - Endpoints / Endpoints Reference
Functions / Binding and Unbinding Endpoints


OTUnbind

Dissociates an endpoint from its address or cancels an asynchronous call to the OTBind function.

C INTERFACE
OSStatus OTUnbind(EndpointRef ref);
C++ INTERFACES
OSStatus TEndpoint::Unbind();
PARAMETERS
ref
The endpoint reference of the endpoint that you are unbinding.
DESCRIPTION
If you call the OTUnbind function asynchronously and you have not installed a notifier function, the only way to determine that the endpoint has been unbound is to use the OTGetEndpointState function to poll the state of the endpoint. The function returns the kOTStateChangeErr result when the OTUnbind function returns. If the function succeeds, the state of the endpoint is T_UNBND. If it fails, its state is T_IDLE.

After you unbind an endpoint, you can no longer use it to send or receive information. You can use the OTCloseProvider function to deallocate memory reserved for the endpoint, or you can use the OTBind function to associate it with another address and then resume transferring data or establishing a connection.

SPECIAL CONSIDERATIONS
In asynchronous mode, the endpoint provider might call your notifier function before the function's initial return.

VALID STATES
T_IDLE

COMPLETION EVENT CODES
T_UNBINDCOMPLETE0x20000002The OTUnbind function has completed. The cookie parameter of the endpoint's notifier function is not used.
SEE ALSO
To bind an endpoint, use the OTBind function, described on page 3-77.

To obtain information about the endpoint's state, use the OTGetEndpointState function, described on page 3-83.

The OTCloseProvider function is described in the chapter "Providers" in
this book.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996